The present invention relates to a method of detecting a motion vector, suitable for use, and in a motion compensation interframe predictive coding apparatus.
In the field of coding image information, a technique called "motion compensation interframe predictive coding" is known in which an image displacement between a previous frame image and a present frame image is detected as a motion vector, and there is coded a difference between the present frame image and a predicted image which is obtained from the previous image on the basis of the motion vector. In this case, it is the procedure to divide one frame image into a plurality of blocks having for example "8.times.8" pixels or "16.times.16" pixels, and motion vector detection and coding processing are performed for each block.
FIG. 1 is a block diagram showing an example of a conventional motion compensation interframe predictive coding apparatus.
In FIG. 1, an input image memory 1 stores input image data of the present frame. A decoded image memory 3 stores image data of the previous frame which is reproduced by decoding coded image data generated by coding image data of the previous frame. The image data corresponds to quantized image data of one frame such as "L.times.M" pixels.
A motion compensation circuit 2 detects as a motion vector an image displacement between input image data D.sub.a and decoded image data D.sub.b, namely, the present frame and the previous frame, in each block and composes predictive image data D.sub.c which are compensated by its motion corresponding to the input image data by using the motion vector and the decoded image data D.sub.b, so as to output the predictive image data D.sub.c to a subtracter 4.
In the subtracter 4, the predictive image data D.sub.c are subtracted from the input image data D.sub.a to generate predictive error data D.sub.d which are coded (quantized) by an encoding circuit 5 to provide coded image data D.sub.g. The coded image data D.sub.g are transmitted or recorded together with the motion vector obtained previously.
At the same time, coded image data D.sub.e which are the same data as DE, are decoded by a decoding circuit 6 to supply to an adder 7. The adder 7 adds decoded data D.sub.f with the predictive image data D.sub.c to reproduce decoded image data D.sub.b which are supplied to and stored in the decoded image memory 3. Accordingly, when the motion detection and coding are completed with respect to entire blocks in the present frame, the decoding image memory 3 stores the present frame image data of "L.times.M" pixels, which will be used in coding processing in the next frame.
FIG. 2 is a block diagram showing a conventional decoding apparatus for decoding the coded image data which are encoded by the apparatus shown in FIG. 1.
In FIG. 2, a decoding circuit 11 decodes the coded image data D.sub.g which are transmitted from the coding apparatus or read out from a recording medium, so as to supply to an adder 12.
Image data D'.sub.h of "L.times.M" pixels, which are image information in the previous frame stored in the decoded image memory 13, are output as the decoded and reproduced image data and supplied to a motion compensation circuit 14. The motion compensation circuit 14 performs motion compensation to the image data D'.sub.h of the previous frame by the motion vector which is transmitted together with the coded image data D.sub.g to compose predictive image data D.sub.i corresponding to the present frame image. The predictive image data D.sub.i is added to an output from the decoding circuit 11 by the adder 12, so as to reproduce decoded image data D.sub.h of the present frame, which are store in the decoded image memory 13.
The above-described processing is performed by a block unit as the same as the coding processing, and when processing of all the blocks of the present frame is completed, the present frame image data of "L.times.M" pixels are reproduced and stored in the decoded image memory 13 and used for decoding processing in the next frame.
However, in the motion vector detection method which is used in the above-mentioned and conventional motion compensation interframe predictive coding apparatus, there is a level difference between the image data of the present frame and the previous frame when there is a fade-out in which one scene fades out or a fade-in which a scene appears slowly. Therefore, it is impossible to precisely detect the motion vector.
The motion vector represents a position displacement of the present frame block which has moved from a position in the previous frame. For example, the block position of the previous frame is obtained so that a square sum of the difference of each pixel in both blocks is the maximum value, and the difference between both blocks is obtained as the numerical value. Accordingly, when there is a luminance difference between both frames, the square sum of both the blocks at the same position becomes larger even though the image does not move, making possible to select an erroneous position where the square sum was too distant. When the image which is coded using such an extremely erroneous motion vector is reproduced by the conventional method, quality of the reproduced image decreases sharply.